<?php
	$album_id = ( isset($_REQUEST['hdn_album_id']) ? $_REQUEST['hdn_album_id'] : 0 ) ;
	$v_display_image = '<ul id="album_image_content">';
	if ( $album_id ){
		if ( getOwnerAlbum($album_id) == $user_id ){
			$rs = getAllImageBasedOnAlbum($album_id);
			while ($arr = mysql_fetch_assoc($rs)){
				$v_image_id = $arr['IMAGE_ID'];
				$v_image_name = $arr['IMAGE_NAME'];
				$v_is_used = $arr['ACCOUNT_AVATAR'];
				$v_image_path = 'lib/upload/thum/'.$arr['IMAGE_LOCATION'];
				$v_display_image .= '
				<li id="img_content_'.$v_image_id.'">
					<div align="center" class="img_content">
						'.dspImagesChangeSize($v_image_path,'id= "img_'.$v_image_id.'" class="album_img"',3).'
						<div class="img_action">
							<a class="button" onclick="deleteImage(\''.$v_image_id.'\')" href="javascript:void(0)">'._IMAGE_DELETE_IMAGE.'</a>
						</div>
					</div>
					<div style="padding-top:30px">
						<div class="img_name button" id="dsp_'.$v_image_id.'" onclick="showEdit(\''.$v_image_id.'\')" >'.displayLongText($v_image_name,MAX_LENGTH_DISPLAY).' '._IMAGE_EDIT_IMAGE.'</div>
						<br/>
						<div class="edit_input" id="edit_'.$v_image_id.'">
							<input id="'.$v_image_id.'" class="input w140" type="text" value="'.$v_image_name.'" onchange="updateInput(this)">
							<a id="btn_back_'.$v_image_id.'"onclick="hideEdit(\''.$v_image_id.'\')" href="javascript:void(0)">'._IMAGE_BACK_IMAGE.'</a>
						</div>
					</div>
					<br/>
					<div><input class="checkbox_status" id="status_'.$v_image_id.'" onclick="updateStatus(\''.$v_image_id.'\')" type="checkbox" '.(($v_is_used ? 'checked value="1"' : 'value=0')).' > '._LB_DISPLAY_IN_HOMEPAGE.' </div>
				</li>';
			}
		}
		else{
			redir('?a=ACC&acc=USER&user=ALBU');
		}
	}
	$v_display_image .= '</ul>';